package com.itheima.ydd.controller;

import com.itheima.ydd.common.R;
import com.itheima.ydd.pojo.SysConfig;
import com.itheima.ydd.service.SysConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("sys_config")
public class SysConfigController {

    @Autowired
    private SysConfigService sysConfigService;

    @PostMapping("update")
    public ResponseEntity<R<String>> update(@RequestBody List<SysConfig> sysConfigList){
         return sysConfigService.update(sysConfigList);
    }

    @GetMapping("all")
    public ResponseEntity<R<Map<String, Object>>> all(){
        return sysConfigService.all();
    }

}
